package net.sxnic.jhitem.itemprincipal;

import net.sxnic.jhitem.itemprincipal.ItemPrincipal;
import net.sxnic.jhitem.itemprincipal.dao.ItemPrincipalDao;
import net.sxinfo.core.spring25.Dao;
import net.sxinfo.core.spring25.DefaultManager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("itemPrincipalManager")
public class DefaultItemPrincipalManager extends DefaultManager<ItemPrincipal,ItemPrincipalDao,String>
		implements ItemPrincipalManager{

	@Autowired
	private ItemPrincipalDao itemPrincipalDao;
	@Override
	protected Dao<ItemPrincipal, String> getEntityDao() {
		return itemPrincipalDao;
	}
	
	/**
	 * 根据主表ID获取负责人实体
	 * @param baseinfoId 主表ID
	 * @return 负责人实体
	 */
	public ItemPrincipal getEntityByBaseinfoId(String baseinfoId)
	{
		return itemPrincipalDao.findByUnique("baseinfoId", baseinfoId);
	}
}
